import http from "./index.js"
/* 编辑相册 */ 
const editaumble =async (data)=>{
    return new Promise((resolve, reject) => {
       http.post("/api/photo/editaumble",data).then(res=>{
           resolve(res)
       })
    })
}
/* 添加相册 */
const addaumble =async (data)=>{
    return new Promise((resolve, reject) => {
       http.post("/api/photo/addaumble",data).then(res=>{
           resolve(res)
       })
    })
}
/* 上传封面名字 */
const submitFileName = async (data)=>{
    return new Promise((resolve, reject) => {
       http.post("/api/photo/submitFileName",data).then(res=>{
           resolve(res)
       })
    })
}
/* 获取相册 */
const getaumble =  async (data)=>{
    return new Promise((resolve, reject) => {
       http.post("/api/photo/getaumble",data).then(res=>{
           resolve(res)
       })
    })
}
/* 获取相册数量 */
const getcount =async ()=>{
    return new Promise((resolve, reject) => {
       http.get("/api/photo/getcount").then(res=>{
           resolve(res)
       })
    })
}
/* 添加照片 */
const addPic =async (data)=>{
    return new Promise((resolve, reject) => {
       http.post("/api/photo/addPic",data).then(res=>{
           resolve(res)
       })
    })
}
/* 获取图片 */
const getPic = async (data)=>{
    return new Promise((resolve, reject) => {
       http.post("/api/photo/getPic",data).then(res=>{
           resolve(res)
       })
    })
}
/* 图片总数 */
const alltotaldata = async (data)=>{
    return new Promise((resolve, reject) => {
       http.get("/api/photo/alltotaldata",{
          params:{
            album_id:data
          }
       }).then(res=>{
           resolve(res)
       })
    })
}
/* 批量删除图片 */
const deletePic = async (data)=>{
    return new Promise((resolve, reject) => {
        http.post("/api/photo/deletePic",data).then(res=>{
            resolve(res)
        })
    })
}
/* 删除 */
const delectaumbles = async (data)=>{
    return new Promise((resolve, reject) => {
        http.post("/api/photo/delectaumbles",data).then(res=>{
            resolve(res)
        })
    })
}

export{
    delectaumbles,
    editaumble,
    addaumble,
    submitFileName,
    getaumble,
    getcount,
    addPic,
    getPic,
    alltotaldata,
    deletePic
}